[lib] code cleanup