Moving logic between activity and fragment