fix creating variants and add tests