Simplify clear function