Folder refactor and logic distribution