Start big code cleanup and refactoring