fix refactor issues