Refactoring in second lab for 301