updated for code review and clarity

changed the lambda function and map call to a more readable list
comprehension and changed the string type checking code to be more
readable in the model
updated variable name for clarity/code review