generalizing the functions