improve dependency injection routines, serialization, minor fixes