some clean up and exported build_env