try with resources.
minor Exception usage fix.
Rename classes