refactor precompile main program