Mixture of `this` and `$scope` used here, even though they refer to same object. Would be good to be consistent.