Abstract out some variables, light cleanup