generate proper element constructor