Refactor now works