some code revision and fix 2 JS specs