Refactored callbacks