Addressed comments made to the code and further cleanups