Split theme JS and jQuery into two separate functions