Core: wip sorting messages