refactored the target runner to make it more robust.