refactor target directory specification