main.jsx refactor