GA code refactor