Refactoring: Prerequisite to support multiple database connections