validation redesigned and prepared for merging code to workers style