Refactored commenting function