Moving some funcs to utils