refactored again