Targetter code refactored a bit