move function back to tools