refactored the current_user method in the application controller and added it as a helper method