Added comment and extracted methods (Refactoring)