Determine Which Page Is Displayed

I would like my tests to navigate around the app based on which page is currently being displayed. This is different than checking if one particular page is displayed. One approach I was thinking about is getting the pageSource from Appium and determining what elements are in the page source and deciding which page is displayed. I was wondering if any other Appium users have encountered this problem before and have created a solution for it.