I've had this with my boys too.
I also tell them that if they want to play with "willy" they should do it in their room/bathroom because it's not nice for other people to see.
It seems to have worked so far