Refactored all inode logic out of main