moved query to module