Changed functions to be members, not scopes