cleans up code and adds additional methods to make the code more readable