refactor precompile