Refactor + debug panel and attribute