simplified API and removed some dependencies