add Comments to methods and classes and refactored code