remove pdf, simplify code