Remove extraneous variables and generally make things more consistent