Reorganizing main activity