reformat and several methods as public, so they can be used from outside