Restructure get_worker

Also add some log messages
Merge pull request #2 from matelakat/restructure-get-worker

Restructure get_worker