code cleanup and dependency fixes for puppet