Use object types instead of variants

Fixes #3