Misc Refactoring