some enhancement in API
code refactor

more verbose
some changes and code refactor