remove unecessary dict, use other way to remove keys

I just tried to refactor these code, because I feel bad when see a for loop with if/elif/else of all cases.

This is result of running test
```
(saltdev)root@u1204: /usr/local/saltdev/salt/tests (pkgrepo_refactor) # ./runtests.py --state pkgrepo
....
OK (total=95, skipped=16, passed=79, failures=0, errors=0) 
```