Master code cleanup