[IMP] Separate function and optimize chatter with context