renamed some variables and refactored some code back into main controller to prevent some unnecessary redefinition on navigation