Reduce prepare_stecells complexity