refactoring. remove for nesting.