Massive refactoring in progress + lots of debug