Model quering refactoring.