some refactoring and starting to add targetting
random small fixes, adding targetting, work in progress