You take the original code and put it to one side to use with any program, this is normal practice of writing programs that contain multiple sub routines that are used over and over. I was involved in a big project we had multiple little routines that were used all the time and as I say where preloaded redy to use.
If you go the the Lisp forum nearly every posted code has a DEFUN this is a mini bit of code. Will post example.