refactored share dialog