Misc. refactoring, javadocing, etc.