Added docblock
Refactored callback function