extract exceptions and Worker class into separate files
extract code into different files according to their logic