28105: factored out units and references to units and defined a bunch of constants in the head of the file