I agree with the covering the trash, and w/Huggy's last post.
You should NEVER hit a dog, especially on their snout. Use your voice, use your alpha-ness, never use your hands.
While that might be true for most dogs I know for a fact there are exceptions.
When my late wife and I were first married we went to buy a dog and she was seduced by a black poodle pup who knew exactly how to get around her, but when we got him home he turned out to be a monster. We would take him for long walks and he would do nothing, but as soon as he got home he would piss and shit on the floor. Sometimes he would look me right in the eye while he was doing it -- and I know he was fully aware he was doing wrong.
After replacing a wall-to-wall carpet he'd ruined I bought a puppy gate to confine him to the kitchen when we were out. That worked out because he couldn't ruin the tile floor (although he did tear up one mat). But I didn't realize he was growing and one day while we both were out he managed to jump over the gate and destroy an expensive sofa. Tore it to shreds. And he shit right on the new carpet.
When we came in and I saw what he'd done I recall feeling like my face was about to explode with rage and I fully intended to kill that dog, whom I had come to despise. He seemed to know that and he tried to get away, but I caught him by the scruff and I became oblivious to my wife screaming at me not to him. I beat that dog so hard my hand was swollen and red.
When I let him go he ran terrified behind the sofa he'd destroyed and stayed there for the rest of the day. My wife was very upset with me but agreed to give the dog away (because I vowed to toss him off the terrace). About nine that evening he slowly emerged from behind the destroyed sofa and skulked over to the door where we had his leash hung on a hook. I watched as he looked at the leash, then looked at me, then back at the leash, and so on, as if to say he wanted to go.
My wife threw on her jacket, took him out, was back in ten minutes, and with a tone of complete resignation said he'd gone right to the curb and did what he'd refused to do for all the months we'd tried every possible way to train him. And from that day forward he never did it in the apartment, or the corridors, or the lobby, or the elevator, again. He would quietly wait by the door when he had to go and he would go right to the curb.
For the next fourteen years
Johnson's behavior was exemplary. We became friends and I really felt bad when we had to put him down. We had Yorkies after that and never a problem with any of them. Wonderful little dogs.