improvement on basic functions