Practice re-factoring code from previous academic assignment