check: rewrite for saner readability and maintainability.