Refactor database to reflect backends