Refactor to rename some IF's to more sensible names.