Remove console.log
Improve readability and adjust whitespace

Update check to see if detailsAttr is undefined
- Improve readability, as typeof undefined will always result in the
string 'undefined'

- Adjust whitespace