fixes to nuget and refactoring to prepare the logic to be smarter