Restructured code, removed scheduler dependency
Restructured code, removed scheduler dependency