refactored it