replaced instance of checks with visitor