split out the functions