switching to OO style

switching to object oriented implementation and trying to get
registration working