overhaul to structure of ffx code