deprecations removed and minor refactoring