refactor custom query views