Big refactor with thousands of changes