add hibernate and cleaned up a bit