Factored input validation further