implement maps for query and model