Big refactor of object dependencies