Restruct and optimization