make r8582 more memory efficient