Refactor, add sharing.