Rework registration (#936)