Move most queries to models.query.Query