refactored generation of file sections
use data types
added a hack to include the preview url