more refactoring and chefspec tests
more tests and code refactoring