Huge refactor and addition of commits.