delete duplicated java code
kill some duplicated java code
Move things around a bit