Simpliy & remove use of deprecated jquery function