moved global AQL functions to internal module