maintenance: replace implicit casts with explicit