Refactored dead code elimination