Refactor stem extensions