Split _compile method in query_builder class