debug&refactor