Cast the right object