moved all validations in the narrowest scope possible in FooMain