Created find_by_email method and refactored application controller