further cleanup for pi