validation refact