Made improvements to code clarity and reduced unnecessary logic

* Removed logic switches for returning an error, error cases will now just raise an exception,
   which will be caught and have its error message printed
 * Split up some overly long functions in separate component functions
 * A few pep8 fixes were made. Not all the code is up to pep8 standards but not a huge dealwq