Fixes refactoring bug