rafactored validation method, translate function.