created query builder and refactored query executor