refactored to use ConnectionHandler again