Refactoring main.cpp

add helper IOfunction.h