Removing the unnecessary message ids which are not being used.