refactoring eventscheduler