separated lookup and print