Lightcurve refactor