Refining class structure, adding doc comments.