SmartQuery library