Improve advanced compile