refactoring of SQL-mapping