Fixed database repo
Database refactor
Refactor database