avoid extra lstat call

Clean up based on joliss suggestions