refactor to errors in validation html code