abstract some jquery functions