Refactor the structure