Detector optimization to reduce the cosmogenic neutron backgrounds in the TAO experiment