some of utils code