reuse cql/ manipulation function