BUG: Fixed refactoring bug