Rename some variables and clean up code a bit more.