Major refactor
Major refactor