Move some stuff to utils