add id lookup, fix structure