Reworked the API a bit