solution for CQRS pattern