Smart derive

Smart derive