Refactoring according to Sonar (rules in doc dir). 96.8% RCI - fixes #19

Signed-off-by: marcanpilami <marsu_pilami@msn.com>