Factor out pieces to sources for better compression