minimize compiling function