Reorging code to prep for app/ext plumbing