renamed some functions and added link_get_stat