refactor module "database"