improved the API a bit