performance twick, working
before simplify and reorganize the implementation
functions renamed and schedulers reorganized