[REQS-609] refactored codes, added docs