Refactored the Account controller