compactify
refactor