Refactor bug