add return type annotations proposed by scrutinizer