Share code; remove dead code