implement basic register constructor