fixed option name typo
rewrote a simpler logic to parsing the connection and authentication options