some minor refactoring
using file blocks
refactoring to use CSV