Refactored the defering mechanism into a reusable component.