Add docblock and made some changes on lib classes