Better collapse code.