tighter logic & something like real parser logic