sorted out the API, moved useful stuff to main header