More refactoring and added more classes.
Added separate hibernate contexts.