moved element parsing to element.c