refactor stucture