made the "setTarget" method a bit more dynamic