How to extract business logic into separate components