Better structure

TODO: check duplicated indices