share buttons code tidy up