Initial refactor pass at Yearfour code