refits; factor out cube loading
use MAD if not bottleneck