Refactor check_work()