Code refactoring: refactor the AccountsController and its spec.