replace Legacy::validateEmailAddress with filter_var()
refactor legacy code