Adding methods to custom classes is no different from adding them to LearningCurve. However, this is a good opportunity to talk about a staple of good programming—Don't Repeat Yourself (DRY). DRY is a benchmark of all well-written code. Essentially, if you find yourself writing the same line, or lines, over and over, it's time to rethink and reorganize. This usually takes the form of a new method to hold the repeated code, making it easier to modify and call that functionality elsewhere.
In programming terms, you'll see this referred to as abstracting out a method or feature.
We have a fair bit of repeated code already, so let's take a look and see where we can increase the legibility and efficiency of our scripts.