removes unnecessary static_casts