refactor common