making some pythonic changes with regards to exception handling and None type if checks, changed imports, removed changed function in preference of using setter, tweaks to imports