move register out of the constructor