refactored checks into a wrapper class for convenience and readability.