fix for serializable types #438
some refactoring
move serialization stuff to new helper class #438
call methods in new helper class #438