merged code cleanup