Refactored business rules into model classes.