Refactored cypher and connect; added exceptions