Optimize chaining scopes, function calls.

Reduces some function scopes