Ported over new structure to master.