Refactoring and adding logging statements to the base machine plugin and fog provider.