minor code refactoring
use new callback for RT 4.2 compatibility