* Refactor validation logic into a short script and a larger library file * Add unit tests for utility functions