Use registration API

Rework registration to use the new registration API.