refactored checker quite heavily