eliminate duplicate nested assignments