refactor performance