refactored connection count command