Migration updates

Refactor database.