cleaned up convertElement