some code cleanup
several updates for cascade