Cleanup and adding proper type to createElt.ts