Added additional element support & code cleanup