generator mode and collector mode support
two mode