Refactor filetree structure