Refactor validation logic to be more testable
Tests for invalid types
Tests for empty strings