break request up into functions instead of control statements