Minor changes to use create_query