Refactored sharing services to be templated.