some serious structure improvements