refactor common methods