Working with sharing and notification. Refactor code.