Updated function for generating EP actions.