BQL refactor and basic features support