changed API to single function