Refactored checker.php