Refactor and structure update