JS Refactoring

Optimization of options + replaced == with === to be more secure