Refactor the account db relative code
Add a base struct for the account manager