remove needless code.
simplify jQuery selector usage.
remove maxConnections parameter.