Refactor conditional.model. Added model tests.