prediction and cleanup work