removed unused $type and moved the seperator to a variable