The `attributes` var should be renamed to something else, it's confusing. How about `media`?