grooming and minor refactor