separate print routes into own function