Major refactoring
Major refactor