Code made generic!