Refactor: removed unnecessary duplicate check on message type