Clear and optimize Engine