Minor cleanup of some code, renamed stuff