fixed bugs in refactor