Cleans up some non-idiomatic java.