Refactored Change

Pulled multiple lines into one function.