Further work on removing rootscope
Some cleaning up after changing variable names