moved all createEle function to one place