MainActivity code cleanup