Cleaned up the API a bit