JAVASCRIPT OPTIMIZATION! database improvements