[lib] code cleanup, added proper help