refactoring pg into query file