added comments to help refactoring