refactoring create entitiy Query