Improve code, change with 'unless'

Small code improvement.