Changes to register+clean-up