Database Refactor