Moving some stuff into util