code reformatting/cleanup & fix parent required in foldertype