updated refactoring