Performance updates

Replaced some jQuery functions with native javascript