missing a var and better DRY