add template function for registering fields; define default constructor
define initialize function