Removed redundant classes and add dependency injection to query builders