Restructure worker API a bit