Remove some dead code.
Inline some code that is only used once.