migrate queries to custom initialization