Improved schduler implementation