begin decomposing into classes to help with testing and reusability