Minor refactor, checking for nil