refactor reactor callback