optimize js and scroll to