Refactor visibility changing code a bit (and make it a little more readable, even though it's still probably pretty bad by any Java standard)