Drop superfluous variables and type casts