Refine MainActivity