simplified some functions