To create socialPost method and consolidate code