Get rid unnecessary duplicate code.