Refactors (including a nifty generalized newtype-deriving)