Moved validation into a trait used by models