refactored comments code