X refactor