create separate test-check file and simplify test-check proc