Next round of refactoring...
Finished second round of refactoring (still some work to do though..)