Template processor