some improvements in form of pie_entity