Registraiton logic