wrap js using javascript pattern