completing the refactoring that was only halfway done.