Don't we already have a tool for this, made way back?
Cant find it right now though.
also, perhaps you could improve the interface,
by adding a line that says 'element (...) bolts: 1, ... 2, ...
Finally, you could put drain life and ice bolt on 1 line, no need to split it up.