Remove whitespace.
Remove legacy subdir code and update checks.
Shorten and simplify the subdirs checks code.