change to jquery plugin format