refactoring to add Account class