Completely reworked the API