Filetree refactored into more consistent parts.