simplify code and update README