Refactoring project to support multiple databases