solving testing bugs for refactor