Added Comments with some refactorings