Refactors previous commit to swap duplicate code for fewer Objects.