introduce a pico template
better validation logic