change register() to chainable API