Change connection representation to HashMap