Query interface improvement and math module removal replaced by libinter