some functions simplified