function calls unified; using temporary variables for better (human) readability