Add some validation and tests