moving out Entity responsibilities from AnalysisService
reformat code