Use type/var blocks. Moved net package's validation to a sep. file.