Refactored reactor.
Refactored test.