Refactored invalid action usage handling