queries: moved logic from mappers to queries