added ControllerStub as an external test object
and some refactoring