Made the valid/invalid keywords outside into tools