refactoring x2