Factoring out the problem logic.
Add support for configurable conditions for problem correctness.