Refactored the CompletedAction class, and made it more generic