Refactor so mechanics don't rely so much on textual names of things.