radical restructure to fix app not starting