remove deprecated API and fixes #33
fixes #6