Refactor folders code