corrected refactor issues