quick and dirty template and encoding