some improvements in structure