refactor, use one method to validate project and task names