core: Just reordering some code
wip