Refine exclude dir generation

fixes #56
fixes #57