remove some test files
add a helper method and fixed a guard issue