[code] move lib to use standard wp code