completed refactoring of datasource controller