Cleaned JS code