refactor common extensions