refactoring doViewAccountDetails method.