cmall code cleanup