refactoring & formatting