Refactor-mania and model query implementation.