library and basic template
merging