remove unnecessary duplicate statements