Merging major refactor