v0.2.2, improve code