fixes law of demeter violations and syntax errors