debug, sync data between view, and refactor