Upgrading type classes approach