split up long method
fix a bug that inappropriately stores detail attributes on the wrong entity