refactoring how stuff gets compacted