extract compile into separate file