simplify and sanitise