rearragned to saner structure