move worker logic to another module
fix compile errors and attached cursor to new scheme