added some basic functions and needful utils