reduce warnings, unused vars, unnecessary casts.