Wrong refactor: compilation error