client refactored to use the right way to declare controllers and factories