I wonder if there is a better way than casting ...