Refactored code so that it's split into packages with more meaningful names.