Refactor of precompute/compute and other things