Split off into calc, filter, plot and stats modules