Code style refactoring

... with minor issue fixing.