Merge "More refactoring to make adding a secondary easier"