refactoring and cleanup
allow closing the connection before Registration and aborting during orderly connection termination