Global refactor first pass