extracted worker to separate class + code clean up