Cleaner way of checking variable.