test for jobs removal during reloading. Cleaning up the code