refactored 2