Updated templates and preprocess functions