Refactored action result handling