Moved registration of listeners to the main class