Codestyle fixes and refactoring. step 3