Split apart some functions into utils