move register assignment into constructor