split it into many, smaller functions