gen2: refactoring + main page