Fixes refactor bug