moved validation sql to db abstraction