Cleaned up a little of the view alter code - to hopefully make it easier to read.