Worked out a little cleaner pyjava thing