[f] fix all bug related to refactoring code