removed mutable local variable in map