some p4 adaptations