minor refactoring: removed unnecessary $apply