Rearrange the code a bit
Mark the library code region

With these marks, we can easily extract the necessary code and embed
them into another script.