Move time into queries
Move time into queries