Light removed again, outsourced some operations to separate functions.