Cleaning code

Consolidated load and parse into one function, cleaned up the code