further work on segments storage, TODO separate headers and  blocks  file, reshape  design  to make it faster