The biggest refactor ever