refactor work directive