complete update of SO2/SE2: fully templated and documented