moving event handling hooks into its own namespace. fixing consecutive signins issue