refactoring and prepare assignment scheduler