renamings and style tweaks to make this more readable