[na] entity and database refactory