Refactor message dropping to be more general