Refactor code to improve clarity.
Revise readme.