added more templates and preprocessing