Major refac.