refactoring to support public concat+compilation