registration using a callback rather than straight contructor