actually refactored