remove unnecessary casts and imports, add @overwrite annotations