Refactored duplicate copy and pasting of clipboard code to the private
_clip_and_print function.