refactor db for requirements