More common code for tools