made cleaner. separated http request part