improve reability of Javascript, remove odd check

Changes tested with Firefox and Chrome