Refactoring datasource configuration + unit tests