minor cleanups

Look at the match(es) stuff, it might be a bit too magical, will edit if needed.