task distribution: improve unit test coverage and cosmetics improvements