refactoring, added named queries