[dev]refactor and add comments for adapter