Refactor deriving

<3 @FreeFull