cleanup deprecated
refactor compileFunc