Refactoring and comment updates