Refactor PlanActivity - no functionality changes, optimization and clarity only