chefspec tests started and more code refactoring