Refactored main page