simplified code a bit so eval logic isn't duplicated