Refactor the Aggregate repository