refactored module and connectionhandler initialisation