Optimizing various aspects of the current code to match and maximize code reusability for this programming assignment.