Adding task repository and fixing event repository pattern