small improvements: cache different environment members in local variables