Initial commit of full refactor