get template and compile improvements and clean up