refactored on CapsuleScheduler