got rid of some more temporary variables