HQL query added
Refactoring