Refactoring of ConnectActivity and made device of CommunicationHandler
a parameter.