Clean up nested-if logic
Merge pull request #14 from clee/cleanup

Clean up nested-if logic

Reviewed-by: Sage Weil <sage@inktank.com>