finished validate refactor