changed API a bit