LAI-1 further extending jquery functionality, code clean-up