Refactored validator & solver