Major refactoring to support request life-cycle.