Group $scope functions together
Switches gateway management to syncing-style