Cleaning up some code more. Improved for readability