make register_template accept template object
implement widgets