jQuery client : refactoring, starting to add validation