refactor: move logic to the model
prevent tasks from being loaded twice
more refactorings on `tasks`
trigger action when task is clicked