start moving validation logic into one place