cleanup
set template compiler
check for script, and cache it