refactor clipboard