Shorten remaining(), add return type annotations