Add jQuery reference in usage and reuse duplicate code