For this first part you can use `as_powers_dict`:

```
>>> (x*y**2).as_powers_dict()
defaultdict(<type 'list'>, {x: 1, y: 2})
```