Updating business logic.

- Still need to fix task inputs.
- TODO add tests.