Double refactor problem solved