Localized some functions to let scopes.