Working on massive refactor