Refactor filesystem