Refactoring RDBMS connectivity