Addressed code review comments.

Clarified logic (used 'unless' rather than 'if not' where appropriate).
Removed superfluous braces from if statement expression.