begin the massive refactorring