unneeded local variable
single function for both