refactor account to pass the unit test