minor streamlining of code