Major refactoring in the code structure