Large file refactor