refactoring + adding jquery