Moved  doAfterTransition into its own module
added destroy method
renaming and tidying up code