simpler handling of connection with hash