add account type and refactoring