refactored and simplified the checkers