fix options passing, simplify logic