2.2.x update, move to class, simplification of some other things.