refactoring, reformat code