Try using Lens for generic programming