Avoid unesscary casts that could cause undefined behvaiors