moved various methods to utils