Extract actions into a testable pattern