simplify code and increase timeout