Refactored out some ternaries.