added Module class and Atomic<bool>