made some functions more readable