Implement Pipe locations in to_action

Originally implemented in 9c2f6764.