Finally made these refactorings work in the standalone. Now to test in GMI.