Reorganize code for upcoming changes