broken some stuff out into utils