jshing and refactoring