code style refactorings + test fix