refactor extension