use template to reduce ObscureCode