Remove redundant assignments and imports