`rp.py` is currently a mess. The `open()` command alone is 119 lines long, and much of that code could be reused if it was moved into functions. This issue will be resolved when `rp.py` has been re-structured to improve readability and code re-usability.