Move sample code and turn some fun to classmethod or staticmethod.
Fixed test.
Tiny rewrited in test.