[Refactoring] reduce code indent depth