more refactoring
refactored to jquery