Began refactoring / code cleanup