Mesomorphism dependence on molecular rigidity and flexibility