cleanup refactoring. No breaking changes