code cleanup from merge