Refactor/moved database

Refactor/moved database