test: move helper codes into helper/ directory