small refactor + adding timeout to request