Hard refactoring. Style changes