move line parsing to model
remove trailing slash and shorten document fields