refactored to main index