move query object patterns to domain