Reorder functions definitions