Extracted get_JW function

I hate this code.