Refact validation