Refactor sharing, add log in.