Exception fix and some scratches.
Optimized maven imports, added comments.
Some refactoring.