light refactoring and format fixing