refactory subject validation