debug and refactor