Update ConnectPlugin.java

Clean-up and format code