refactored