refactoring excute query