Removing the use of mutable local variables