'make mid' and some cleanup