clash refactor