removing dependency to jQuery, and optimizations