Replaced some native JS functions with Jquery ones