refactor database
refactor accounts struct, token manager, core utils