refactor handling large object