tiny refactoring and code formatting