improve reability of Javascript, remove odd check