adding and improving some utils