revert commit e358ae186 and adapt return type