improved version of the input validator - easier to add new keywords