tiny cleanup
use 'switch' for cleaner code
tiny code and javadoc cleanup