Move data sorting to service.