re-wrote how associations are done and made perf enhancements